Skip to content

fix(workspace): force-remove workspace folder with restrictive permissions#297

Merged
skevetter merged 2 commits into
mainfrom
d865-aa8e-ws-a-delete-bug
May 15, 2026
Merged

fix(workspace): force-remove workspace folder with restrictive permissions#297
skevetter merged 2 commits into
mainfrom
d865-aa8e-ws-a-delete-bug

Conversation

@skevetter

Copy link
Copy Markdown
Contributor

Summary

  • Root cause: workspace delete failed when the workspace folder had restrictive permissions (e.g. 0500) set by the container runtime, causing os.RemoveAll to return permission-denied errors
  • Fix: added forceRemoveAll in cmd/agent/workspace/delete.go that uses os.Chmod to restore write permissions on directories before removing, with fallback to direct removal
  • Unit tests added in cmd/agent/workspace/delete_test.go
  • E2e test added in e2e/tests/down/down.go covering delete with restrictive folder permissions

Fixes skevetter/devpod#754

skevetter added 2 commits May 14, 2026 19:27
Container runtimes like crun (used by Podman) can leave directories
inside the workspace content folder without write permission. The
standard os.RemoveAll fails on these and the error was silently
discarded, leaving the workspace directory behind after delete.

Add forceRemoveAll that retries removal after making all directories
writable. Also log the error if removal still fails instead of
silently ignoring it.

Fixes: #754
@netlify

netlify Bot commented May 15, 2026

Copy link
Copy Markdown

Deploy Preview for devsydev canceled.

Name Link
🔨 Latest commit 36a23a9
🔍 Latest deploy log https://app.netlify.com/projects/devsydev/deploys/6a066aa8b6205a0008be8afc

@coderabbitai

coderabbitai Bot commented May 15, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@skevetter has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 4 minutes and 37 seconds before requesting another review.

You’ve run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3e6901ef-3922-4f4f-b9a2-46ce8d318a23

📥 Commits

Reviewing files that changed from the base of the PR and between 6ef0418 and 36a23a9.

📒 Files selected for processing (4)
  • cmd/agent/workspace/build.go
  • cmd/agent/workspace/delete.go
  • cmd/agent/workspace/delete_test.go
  • e2e/tests/down/down.go

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@skevetter
skevetter marked this pull request as ready for review May 15, 2026 00:41
@skevetter
skevetter enabled auto-merge (squash) May 15, 2026 00:41
@skevetter
skevetter merged commit f8f41f6 into main May 15, 2026
57 checks passed
@skevetter
skevetter deleted the d865-aa8e-ws-a-delete-bug branch May 15, 2026 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Workspace directory is not fully deleted with devpod delete

1 participant